package com.exce.controller;

import com.exce.enums.ErrorEnum;
import com.exce.service.ExceptionService;
import com.exce.vo.Response;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * @author yinxing
 * @date 2022-09-09
 */
@RestController
public class ExceptionController {

    @Resource
    private ExceptionService exceptionService;

    @RequestMapping("/test")
    public Response test(String message) {
        int i=0;
        System.out.println(10/i);
        return Response.success(ErrorEnum.SUCCESS.getErrorMsg(),null);
    }

    @RequestMapping("/test1")
    public Response test1(String message) {
        exceptionService.makeException();
        return Response.success(ErrorEnum.SUCCESS.getErrorMsg(),null);
    }

}
